#define DEBUG
#include <cstdio>
#define MAXN 300000
#define MAXM 300000

using namespace std;

int min(int a, int b) {
  return a<b ? a : b;
}

int max(int a, int b) {
  return a>b ? a : b;
}

class Set {
public:
  int fa[MAXN*2+1], rank[MAXN*2+1];

  void init(int n) {
    for (int i=1; i<=n; i++) {
      fa[i] = i, rank[i] = 1;
    }
  }

  int getFa(int o) {
    return fa[o]==o ? o : getFa(fa[o]);
  }

  void merge(int a, int b) {
    a = getFa(a), b = getFa(b);
    if (rank[a]<rank[b]) {
      fa[a] = b;
    } else {
      fa[b] = a;
      if (rank[a]==rank[b]) {
	rank[a]++;
      }
    }
  }

  void split(int a) {
    int temp=fa[a];
    fa[a]=a;
    rank[a]=1;
  }
};

class SegmentTree {
public:
  bool mark[MAXN*4+1][2];
  Set set;

  void add(int o, int l, int r, int tl, int tr, int u, int v) {
    if (l==tl && r==tr) {
      mark[o][0]=u, mark[o][1]=v;
    } else {
      int mid=(l+r)/2;
      if (tl<=mid && tr>=l) {
	add(o*2, l, mid, max(tl, l), min(tr, mid), u, v);
      }
      if (tl<=r && tr>mid) {
	add(o*2, mid+1, r, max(tl, mid+1), min(tr, r), u, v);
      }
    }
  }

  void solve(int o, int l, int r) {
  }
};

int main() {
  freopen("graph.in", "r", stdin);
  freopen("graph.out", "w", stdout);

  static int a[MAXN+1], b[MAXN+1], time[MAXN+1];
  static bool book[MAXN+1];
  static SegmentTree tree;
  int n, m, p=0;
  scanf("%d %d", &n, &m);
  for (int i=1; i<=m; i++) {
    int type;
    scanf("%d", &type);
    if (type) {
      p++;
      scanf("%d %d", a+p, b+p);
      a[p]++, b[p]++, time[p]=i;
    } else {
      int t;
      scanf("%d", &t);
      book[t]=true;
      tree.add(1, 1, m, time[t], i, a[t], b[t]);
    }
  }
  for (int i=1; i<=n; i++) {
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
